package com.example.pingze.repository;

import com.example.pingze.entity.Compete;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface CompeteRepository extends JpaRepository<Compete, String> {
    Compete findCompeteByKeyWordAndContent(String keyWord, String content);

    @Query("select c from Compete c where c.keyWord = ?1 order by c.time asc")
    List<Compete> findCompeteByKeyWord(String keyWord);
    Compete findCompeteByIdAndAccount(String id, String account);

    List<Compete> findCompetesByAccountAndKeyWord(String account, String keyword);
}
